import axiosIns from '@/utils/request';
const proxyStr = '/proxy_abhd';

export const fetchHdgl = {
  pageList: (data) => {
    const { pageIndex = 1, pageSize = 10 } = data;
    delete data.pageIndex;
    delete data.pageSize;
    return axiosIns.post(`${proxyStr}/abhd/jbxx/queryJbxxPageList`, data, {
      params: { pageIndex, pageSize }
    });
  },
  addItem: (data) => {
    return axiosIns.post(`${proxyStr}/abhd/jbxx/addJbxx`, data);
  },
  updateItem: (data) => {
    return axiosIns.put(`${proxyStr}/abhd/jbxx/updateJbxx`, data);
  },
  deleteItem: (id) => {
    return axiosIns.delete(`${proxyStr}/abhd/jbxx/deleteJbxx/${id}`);
  },
  countItem: () => {
    return axiosIns.post(`${proxyStr}/abhd/jbxx/queryJbxxCount`);
  },
  copyItem: (data) => {
    return axiosIns.put(`${proxyStr}/abhd/jbxx/copyJbxx`, data);
  },
  uploadFile: (data) => {
    return axiosIns.post(`${proxyStr}/abhd/jbxx/uploadJbxxFjxx`, data);
  },
  deleteFile: (fileId) => {
    return axiosIns.delete(`${proxyStr}/abhd/jbxx/deleteJbxxFjxx/${fileId}`);
  },
}